Skip to content

[0.4.x] libvisual-plugins: Resolve use of function "mremap" in input plug-in "mplayer" (e.g. for macOS) - #277

Merged
hartwork merged 2 commits into
0.4.xfrom
0.4.x-mplayer-resolve-mremap
Feb 14, 2023
Merged

hartwork merged 2 commits into
0.4.xfrom
0.4.x-mplayer-resolve-mremap

Conversation

@hartwork

Copy link
Copy Markdown
Member

No description provided.

priv->mmap_area = NULL;

priv->mmap_area = mmap( 0, sizeof( mplayer_data_t ) + buffer_size,
PROT_READ, MAP_SHARED, priv->fd, 0 );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a need to set mmap_area first to NULL? It looks like mmap() is guaranteed to set mmap_area regardless of success or error.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaixiong you're right, fixed and pushed.

Same error on all of macOS 10.15, macOS 11, macOS 12:
> libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../../../../libvisual-plugins-0.4.1/plugins/input/mplayer -I../../.. -I../../../../libvisual-plugins-0.4.1 -I/Users/runner/.local/include/libvisual-0.4 -g -O2 -DUNIX_X -D_REENTRANT -MT input_mplayer.lo -MD -MP -MF .deps/input_mplayer.Tpo -c ../../../../libvisual-plugins-0.4.1/plugins/input/mplayer/input_mplayer.c  -fno-common -DPIC -o .libs/input_mplayer.o
> ../../../../libvisual-plugins-0.4.1/plugins/input/mplayer/input_mplayer.c:183:20: error: implicit declaration of function 'mremap' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>         priv->mmap_area = mremap( priv->mmap_area, sizeof( mplayer_data_t ),
>                           ^
> ../../../../libvisual-plugins-0.4.1/plugins/input/mplayer/input_mplayer.c:183:18: warning: incompatible integer to pointer conversion assigning to 'mplayer_data_t *' from 'int' [-Wint-conversion]
>         priv->mmap_area = mremap( priv->mmap_area, sizeof( mplayer_data_t ),
>                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@hartwork
hartwork force-pushed the 0.4.x-mplayer-resolve-mremap branch from e3a2e1d to 925f8aa Compare February 14, 2023 15:27
@hartwork
hartwork requested a review from kaixiong February 14, 2023 15:27
@hartwork
hartwork merged commit ab8d225 into 0.4.x Feb 14, 2023
@hartwork
hartwork deleted the 0.4.x-mplayer-resolve-mremap branch February 14, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants